<template>
    <a-date-picker v-model:value="modelValue" :value-format="valueFormat" :style="styleWidth" :show-time="showTime" :placeholder="placeholder" @change="onChange" @ok="onOk" />
</template>
<script setup>
import { computed, onMounted } from "vue"
const props = defineProps({
    placeholder: {
        type: String,
        default: '请选择日期'
    },
    showTime: {
        type: Boolean,
        default: true
    },
    valueFormat: {
        type: String,
        default: 'YYYY-MM-DD HH:mm:ss'
    },
    width: {
        type: String,
        default: '100%'
    },
})

const modelValue = defineModel()

console.log('modelValue', modelValue.value)

const styleWidth = computed(() => {
    return { width: props.width }
})

onMounted(() => {
    modelValue.value = modelValue.value
})
</script>